﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using MySql.Data.MySqlClient;
using IPTV.dao;
using IPTV.module;
using System.Data;
using IPTV.util;

/// <summary>
///indexService 的摘要说明
/// </summary>
namespace IPTV.service
{
    public class PrimaryTopicService
    {
        public PrimaryTopicService()
        {
            
        }


        public List<PlateDto> getPlatByGradeNSubject( string subjectId)
        {
            PlateDao platDao = new PlateDao();
            return platDao.findPlatByGradeSubjectKind("小学", subjectId, CommonUtil.PRIMARY_PLATE_KIND);
        }

        public Dictionary<string, List<CourseDto>> getCoursesByPlate(List<PlateDto> plateList)
        {
            PlateDao plateDao = new PlateDao();
            Dictionary<string, List<CourseDto>> plateCourseMap = new Dictionary<string, List<CourseDto>>();
            foreach (PlateDto plate in plateList)
            {
                List<CourseDto> tmpList = plateDao.findCourseByPlateId(plate.Id);
                plateCourseMap.Add(plate.Id.ToString(), tmpList);
            }
            return plateCourseMap;

        }
    }


}